From: Andrew Cooper Date: Tue, 24 May 2016 10:56:58 +0000 (+0100) Subject: x86/pagewalk: Improve print_gw() X-Git-Tag: archive/raspbian/4.11.1-1+rpi1~1^2~66^2~3279 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/%22bookmarks://%22Dat/%22http:/www.example.com/cgi/%22https:/%22bookmarks:/%22Dat?a=commitdiff_plain;h=fb06017f807d45f43b86be33311694c6665ac182;p=xen.git x86/pagewalk: Improve print_gw() print_gw() has no callers, meaning that it only gets used as part of manual debugging. As such, the FILE/LINE references are of no practical use, and voluminous in the log. Additionally, the function becoming empty in a non-debug build is unhelpful. Switch from gdprintk() to gprintk(). Print the entry and mfn for a specific level on the same line. This halves the number of lines printed overall. There needs to be a small adjustment to the #ifdef'ary to maintain the proper l3e behaviour for 3-level paging, where there is no l3mfn to print. Signed-off-by: Andrew Cooper Acked-by: Tim Deegan --- diff --git a/xen/include/asm-x86/guest_pt.h b/xen/include/asm-x86/guest_pt.h index 79ed4ff561..3ec9acedd7 100644 --- a/xen/include/asm-x86/guest_pt.h +++ b/xen/include/asm-x86/guest_pt.h @@ -310,21 +310,23 @@ guest_walk_tables(struct vcpu *v, struct p2m_domain *p2m, unsigned long va, walk_t *gw, uint32_t pfec, mfn_t top_mfn, void *top_map); /* Pretty-print the contents of a guest-walk */ -static inline void print_gw(walk_t *gw) +static inline void print_gw(const walk_t *gw) { - gdprintk(XENLOG_INFO, "GUEST WALK TO %#lx:\n", gw->va); + gprintk(XENLOG_INFO, "GUEST WALK TO %p\n", _p(gw->va)); #if GUEST_PAGING_LEVELS >= 3 /* PAE or 64... */ #if GUEST_PAGING_LEVELS >= 4 /* 64-bit only... */ - gdprintk(XENLOG_INFO, " l4mfn=%" PRI_mfn "\n", mfn_x(gw->l4mfn)); - gdprintk(XENLOG_INFO, " l4e=%" PRI_gpte "\n", gw->l4e.l4); - gdprintk(XENLOG_INFO, " l3mfn=%" PRI_mfn "\n", mfn_x(gw->l3mfn)); + gprintk(XENLOG_INFO, " l4e=%" PRI_gpte " l4mfn=%" PRI_mfn "\n", + gw->l4e.l4, mfn_x(gw->l4mfn)); + gprintk(XENLOG_INFO, " l3e=%" PRI_gpte " l3mfn=%" PRI_mfn "\n", + gw->l3e.l3, mfn_x(gw->l3mfn)); +#else /* PAE only... */ + gprintk(XENLOG_INFO, " l3e=%" PRI_gpte "\n", gw->l3e.l3); #endif /* PAE or 64... */ - gdprintk(XENLOG_INFO, " l3e=%" PRI_gpte "\n", gw->l3e.l3); #endif /* All levels... */ - gdprintk(XENLOG_INFO, " l2mfn=%" PRI_mfn "\n", mfn_x(gw->l2mfn)); - gdprintk(XENLOG_INFO, " l2e=%" PRI_gpte "\n", gw->l2e.l2); - gdprintk(XENLOG_INFO, " l1mfn=%" PRI_mfn "\n", mfn_x(gw->l1mfn)); - gdprintk(XENLOG_INFO, " l1e=%" PRI_gpte "\n", gw->l1e.l1); + gprintk(XENLOG_INFO, " l2e=%" PRI_gpte " l2mfn=%" PRI_mfn "\n", + gw->l2e.l2, mfn_x(gw->l2mfn)); + gprintk(XENLOG_INFO, " l1e=%" PRI_gpte " l1mfn=%" PRI_mfn "\n", + gw->l1e.l1, mfn_x(gw->l1mfn)); } #endif /* _XEN_ASM_GUEST_PT_H */